package com.chaopei.day07;

import java.io.*;

/**
 * @Author Corday 天涯
 * @Date 2022/3/11 18:44
 */
public class MyProg {
    public  static  void get(){
        FileInputStream in;
        ObjectInputStream ois;
        try {
            in = new FileInputStream("c:/temp/users.txt");
            ois = new ObjectInputStream(in);
            while (true){
                try {
                   Us temp =(Us)ois.readObject();
                    System.out.println(temp.getUname());
                }catch (EOFException ex){
                    break;
                }
            }
            ois.close();
            in.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }catch (ClassNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}
class  Test{
    public static void main(String[] args) {
     MyProg.get();
    }
}